The click event is ignored when using an app indicator tray icon · Issue #6773 · electron/electron · GitHub 您所在的位置:网站首页 click app icon The click event is ignored when using an app indicator tray icon · Issue #6773 · electron/electron · GitHub

The click event is ignored when using an app indicator tray icon · Issue #6773 · electron/electron · GitHub

#The click event is ignored when using an app indicator tray icon · Issue #6773 · electron/electron · GitHub| 来源: 网络整理| 查看: 265

IIRC, EntryActivated isn't what you want for this; it's explicitly not a click event. So, let's say you're a user and you have three appindicators in your bar, something system provided like the network menu, the system provided bluetooth menu and your electron app provided appindicator. The user mouse downs (and then mouse ups) on the network icon which displasy a menu. The user mouse moves from the network icon to under the bluetooth icon, which hides the first network menu and displays the bluetooth menu. The user continues to move their mouse to the electron app's icon (and not touch any buttons!), dismissing the first menu, but then breaking the menu scrubbing as your app treats the mouse over as a click, and you make your own x11 window which takes focus.

I'm trying to steer you away from treating the appindicator area as a set of buttons because the appindicator model, both to the programmer and the user, is that of a menu, and you're going to break user expectations in not-so-subtle ways if you treat it as a set of buttons. The unity appindicator area is implemented with GtkMenu (and iirc, the kde one is implemented with QMenu), and uses dbusmenu to copy the GtkMenu/QMenu structure from the user program to the menu displayed by the appindicator widget, and then ferries menu events from the appindicator widget back to the GtkMenu/QMenu instance in your program.

The way you're proposing to do things will break menu scrubbing, including accidental scrubbing, which happens all the time. This is why I'm trying to push you to use something like chrome's current replacement menu item workaround."



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有